import baseService from "@/service/baseService";
import { IObject } from "@/types/interface";

/** BMS 监控 API */
export const bmsApi = {
  /** 电池监控-列表 GET /sys/bms/page */
  getPage: (params: IObject, headers?: IObject) => baseService.get("/bms/page", params, headers),

  /** 实时数据 GET /sys/bms/realDate */
  getRealData: (params: IObject, headers?: IObject) =>
    baseService.get("/bms/realDate", params, headers),

  /** 历史数据 GET /sys/bms/history */
  getHistoryData: (params: IObject, headers?: IObject) =>
    baseService.get("/bms/history", params, headers),

  /** 历史数据-导出 GET /bms/historyData/export */
  exportHistoryData: (params: IObject, headers?: IObject) =>
    baseService.get("/bms/historyData/export", params, headers),

  /** 故障分页查询 GET /bms/fault/history */
  getFaultPage: (params: IObject, headers?: IObject) =>
    baseService.get("/bms/fault/history", params, headers),

  /** 故障关闭 PUT /bms/fault/history_status */
  closeFault: (data: IObject, headers?: IObject) =>
    baseService.put("/bms/fault/history_status", data, headers),

  /** 故障详情查看 GET /bms/fault/history_detail */
  getFaultDetail: (params: IObject, headers?: IObject) =>
    baseService.get("/bms/fault/history_detail", params, headers),

  /** 预警分页查询 GET /bms/fault/predict */
  getEarlyWarningPage: (params: IObject, headers?: IObject) =>
    baseService.get("/bms/fault/predict", params, headers),

  /** 预警关闭 PUT /bms/fault/predict_status */
  closeEarlyWarning: (data: IObject, headers?: IObject) =>
    baseService.put("/bms/fault/predict_status", data, headers),

  /** 预警详情查看 GET /bms/fault/predict_detail */
  getEarlyWarningDetail: (params: IObject, headers?: IObject) =>
    baseService.get("/bms/fault/predict_detail", params, headers)
};

export default bmsApi;
